<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <!-- 
    .stop
      阻止事件冒泡
    .prevent
      阻止默认行为
    .native
      监听组件根元素的原生事件
        <Back-top @click.native="backClick"/>
   -->
  <div id="app">
    <img src="../src/事件修饰符.png" alt="事件修饰符">
    <div>
      <a href="https://www.baidu.com" @click.prevent="handle">跳转百度</a>
    </div>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    const vm = new Vue({
      el: "#app",
      data: {},
      methods: {
        handle() {
          console.log(`阻止了事件的跳转`);
        }
      }
    });

  </script>
</body>

</html>
